/**
 * 废旧工作台-获取公告
 */
function apiGetNotice() {
  console.log("apiGetNotice");
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: [
        {
          id: 1,
          title: "开工大吉丨万事开门红，携手新征程！",
          link: "https://www.feijiu.net",
        },
        {
          id: 2,
          title: "开工大吉丨万事开门红，携手新征程！",
          link: "https://www.feijiu.net",
        },
        {
          id: 3,
          title: "开工大吉丨万事开门红，携手新征程！",
          link: "https://www.feijiu.net",
        },
      ],
    };
    const err = {
      code: 500,
      msg: "获取公告失败",
    };
    setTimeout(() => {
      resolve(res);
    });
  });
}
/**
 * 废旧工作台-获取商机管理
 */
function apiGetBusinessManagement() {
  console.log("apiGetBusinessManagement");
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: [
        ["999+", 12, 8], // 发布的信息
        [56, 95, 95], // 订阅的信息
        [54, 12, 8], // 推荐的生意
        [56, 95], // 收藏的生意
      ],
    };
    const err = {
      code: 500,
      msg: "获取商机管理失败",
    };
    setTimeout(() => {
      resolve(res);
    }, 500);
  });
}

/**
 * 废旧工作台-获取增值提效
 */
function apiGetValueImprovement() {
  console.log("apiGetValueImprovement");
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: {
        // 上边最大的两个
        top: [
          {
            id: 1,
            title: "【视频分发】限时免费1111111111111111111111111",
            desc: "视频分发，统一管理抖音、快手等视频平台111111111111111111111",
            icon: "spff-b",
            link: "https://www.feijiu.net",
          },
          {
            id: 2,
            title: "聊天新上线！",
            desc: "商铺增加聊天功能，祝你快速做成新生意",
            icon: "splt-b",
            link: "https://www.feijiu.net",
          },
        ],
        // 列表
        all: [
          {
            id: 3,
            title: "Feijiu会员",
            icon: "fjhy",
            link: "https://www.feijiu.net",
          },
          {
            id: 4,
            title: "视频分发",
            icon: "spff",
            link: "https://www.feijiu.net",
          },
          {
            id: 5,
            title: "商铺聊天",
            icon: "splt",
            link: "https://www.feijiu.net",
          },
          {
            id: 6,
            title: "市场地图",
            icon: "scdt",
            link: "https://www.feijiu.net",
          },
          {
            id: 7,
            title: "电子名片",
            icon: "dzmp",
            link: "https://www.feijiu.net",
          },
          {
            id: 8,
            title: "生意锁定",
            icon: "sysd",
            link: "https://www.feijiu.net",
          },
          {
            id: 9,
            title: "固定排名",
            icon: "gdpm",
            link: "https://www.feijiu.net",
          },
          {
            id: 10,
            title: "黄金展位",
            icon: "hjzw",
            link: "https://www.feijiu.net",
          },
          {
            id: 11,
            title: "询价单",
            icon: "xjd",
            link: "https://www.feijiu.net",
          },
          {
            id: 12,
            title: "生态会员",
            icon: "sthy",
            link: "https://www.feijiu.net",
          },
          {
            id: 13,
            title: "我要报价",
            icon: "wybj",
            link: "https://www.feijiu.net",
          },
        ],
        // 正在使用
        use: [
          {
            id: 7,
            title: "电子名片",
            icon: "dzmp",
            link: "https://www.feijiu.net",
          },
          {
            id: 8,
            title: "生意锁定",
            icon: "sysd",
            link: "https://www.feijiu.net",
          },
          {
            id: 9,
            title: "固定排名",
            icon: "gdpm",
            link: "https://www.feijiu.net",
          },
        ],
      },
    };
    const err = {
      code: 500,
      msg: "获取增值提效失败",
    };
    setTimeout(() => {
      resolve(res);
    }, 500);
  });
}

/**
 * 废旧工作台-获取我的商铺
 */
function apiGetMyShop() {
  console.log("apiGetMyShop");
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: {
        score: 91, // 评分
        rank: 9999, // 排名
        rankChange: -245, // 排名变化 1上升 0不变 -1下降
        improveNum: 4, // 需要优化的数量
        improveContent: [
          {
            id: 1,
            title: "优化广告，提升广告排名提升广告排名提升广告排名提升广告排名",
            link: "https://www.feijiu.net",
          }, // 优化内容
          {
            id: 2,
            title: "优化广告，提升广告排名提升广告排名",
            link: "https://www.feijiu.net",
          }, // 优化内容
          {
            id: 3,
            title: "优化广告，提升广告排名",
            link: "https://www.feijiu.net",
          }, // 优化内容
        ],
      },
    };
    const err = {
      code: 500,
      msg: "获取我的商铺失败",
    };
    setTimeout(() => {
      resolve(res);
    }, 500);
  });
}

/**
 * 废旧工作台-获取推荐
 * @param {Munber} type - 1: 资产处置推荐 2: 招标拍卖推荐
 */
function apiGetRecommend(data) {
  console.log("apiGetRecommend", data);
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: [
        {
          id: 1,
          title:
            "渭南地区转让环保污染气体在线监测渭南地区转让环保污染气体在线监测",
          link: "https://www.feijiu.net",
        },
        {
          id: 2,
          title: "渭南地区转让环保污染",
          link: "https://www.feijiu.net",
        },
        {
          id: 3,
          title: "渭南地区转让环保污染气体在线监测渭南地区转让环保",
          link: "https://www.feijiu.net",
        },
        {
          id: 4,
          title: "渭南地区转测",
          link: "https://www.feijiu.net",
        },
        {
          id: 5,
          title: "渭南地区转让环保污染气体在线监测渭南地区转让环保在线监测",
          link: "https://www.feijiu.net",
        },
        {
          id: 6,
          title: "渭南地区转让环监测",
          link: "https://www.feijiu.net",
        },
        {
          id: 7,
          title: "渭南地区转让环保污染气体",
          link: "https://www.feijiu.net",
        },
        {
          id: 8,
          title: "渭南地区转让环保污染气体在线监测渭南地在线监测",
          link: "https://www.feijiu.net",
        },
        {
          id: 9,
          title: "渭南地区转让环保测",
          link: "https://www.feijiu.net",
        },
        {
          id: 10,
          title: "渭南地区让环保污染气体在线监测",
          link: "https://www.feijiu.net",
        },
        {
          id: 11,
          title: "渭南地区转让环保污染气体在线监测渭在线监测",
          link: "https://www.feijiu.net",
        },
        {
          id: 12,
          title: "渭南地区转让环保气体在线监测",
          link: "https://www.feijiu.net",
        },
        {
          id: 13,
          title: "渭南地区转让环保污线监测",
          link: "https://www.feijiu.net",
        },
        {
          id: 14,
          title: "渭南地区转让环保污染气体在线监测气体在线监测",
          link: "https://www.feijiu.net",
        },
      ],
    };
    const err = { code: 500, msg: "获取推荐失败" };
    setTimeout(() => {
      resolve(res);
    }, 500);
  });
}

/**
 * 废旧工作台-获取用户信息
 */
function apiGetUserInfo() {
  console.log("apiGetUserInfo");
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: {
        name: "张三", // 用户名
        avatar:
          "https://img1.baidu.com/it/u=1052397826,1513523633&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500", // 头像
        point: 2800, // 积分
        phone: "13800138000", // 手机号
        company: "上海飞九科技有限公司", // 公司名称
        vip: 10, // TODO
        auth: [
          { id: 1, title: "实名认证" }, // 认证信息
          { id: 2, title: "实地认证" }, // 认证信息
          { id: 3, title: "第三方认证" }, // 认证信息
        ], // 认证信息
        auth_tip: 0, // 是否显示认证信息提示 1: 显示 0: 不显示
        inquiry_num: 99, // 询盘数量
        // inquiry: [
        // {
        //   id: 1,
        //   title:
        //     "长期收购二手废旧电梯，直梯，扶梯等等等长期收购二手废旧电梯，直梯，扶梯等等等",
        //   link: "https://www.feijiu.net",
        // }, // 询盘信息
        // {
        //   id: 2,
        //   title: "长期收购二手废旧电梯，直梯",
        //   link: "https://www.feijiu.net",
        // }, // 询盘信息
        // {
        //   id: 3,
        //   title: "行情长期收购二手废旧电梯，直梯报价",
        //   link: "https://www.feijiu.net",
        // }, // 询盘信息
        // ], // 询盘信息
        message: 10, // 消息数量
        industry: "再生塑料", // 行业
        expiration: "2024-08-18", // 会员到期时间
      },
    };
    const err = { code: 500, msg: "获取用户信息失败" };
    setTimeout(() => {
      resolve(res);
    }, 500);
  });
}

/**
 * 废旧工作台-获取成交速递
 */
function apiGetSpeed() {
  console.log("apiGetSpeed");
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: [
        {
          id: 1,
          company: "河北地区****机床厂1",
          value: "50w",
          link: "https://www.feijiu.net",
        },
        {
          id: 2,
          company: "河北地区****机床厂",
          value: "100w",
          link: "https://www.feijiu.net",
        },
        {
          id: 3,
          company: "河北地区****物资回收机床厂",
          value: "2356",
          link: "https://www.feijiu.net",
        },
        {
          id: 4,
          company: "河北地区****机床厂",
          value: "160w",
          link: "https://www.feijiu.net",
        },
        {
          id: 5,
          company: "河北地区****机床厂2",
          value: "50w",
          link: "https://www.feijiu.net",
        },
        {
          id: 6,
          company: "河北地区****机床厂",
          value: "100w",
          link: "https://www.feijiu.net",
        },
        {
          id: 7,
          company: "河北地区****物资回收机床厂",
          value: "2356",
          link: "https://www.feijiu.net",
        },
        {
          id: 8,
          company: "河北地区****机床厂",
          value: "160w",
          link: "https://www.feijiu.net",
        },
        {
          id: 9,
          company: "河北地区****机床厂3",
          value: "50w",
          link: "https://www.feijiu.net",
        },
        {
          id: 10,
          company: "河北地区****机床厂",
          value: "100w",
          link: "https://www.feijiu.net",
        },
        {
          id: 11,
          company: "河北地区****物资回收机床厂",
          value: "2356",
          link: "https://www.feijiu.net",
        },
        {
          id: 12,
          company: "河北地区****机床厂",
          value: "160w",
          link: "https://www.feijiu.net",
        },
      ],
    };
    const err = { code: 500, msg: "获取成交速递失败" };
    setTimeout(() => {
      resolve(res);
    }, 500);
  });
}

/**
 * 废旧工作台-获取排名
 */
function apiGetRank() {
  console.log("apiGetRank");
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: [
        {
          id: 1,
          title: "大庆废旧物资回收有限公司",
          score: "98",
          link: "https://www.feijiu.net",
        },
        {
          id: 2,
          title: "河南钟鼎再生资源回收有限公司河南钟鼎再生资源回收有限公司",
          score: "96",
          link: "https://www.feijiu.net",
        },
        {
          id: 3,
          title: "武汉东拾再生资源回收有限公司",
          score: "88",
          link: "https://www.feijiu.net",
        },
        {
          id: 4,
          title: "北京勋茗再生物资回收有限公司",
          score: "84",
          link: "https://www.feijiu.net",
        },
        {
          id: 5,
          title: "宜昌博源再生资源有限公司",
          score: "64",
          link: "https://www.feijiu.net",
        },
      ],
    };
    const err = { code: 500, msg: "获取排名失败" };
    setTimeout(() => {
      resolve(res);
    }, 500);
  });
}

/**
 * 废旧工作台-获取行情报价
 * @param {Munber} type - 1: 废金属 2: 再生塑料 3：废纸
 */
function apiGetQuotation(data) {
  console.log("apiGetQuotation", data);
  return new Promise((resolve, reject) => {
    const res = {
      code: 200,
      data: [
        {
          id: 1,
          title: "河北紫铜",
          value: "5263",
          date: "12/16",
          change: 1, // 1: 涨 -1: 跌 0: 不变
        },
        {
          id: 2,
          title: "河北紫铜1",
          value: "4512",
          date: "12/16",
          change: 0, // 1: 涨 -1: 跌 0: 不变
        },
        {
          id: 3,
          title: "河北紫铜",
          value: "3562",
          date: "12/15",
          change: 1, // 1: 涨 -1: 跌 0: 不变
        },
        {
          id: 4,
          title: "河北紫铜2",
          value: "3215",
          date: "12/10",
          change: -1, // 1: 涨 -1: 跌 0: 不变
        },
        {
          id: 5,
          title: "台州ABS黑色电视机壳破碎料",
          value: "5440-55560",
          date: "12/8",
          change: 0, // 1: 涨 -1: 跌 0: 不变
        },
        {
          id: 6,
          title: "台州ABS黑色电视机壳破碎料",
          value: "5440-55560",
          date: "12/3",
          change: 0, // 1: 涨 -1: 跌 0: 不变
        },
        {
          id: 7,
          title: "台州ABS黑色电视机壳破碎料台州ABS黑色电视机壳破碎料",
          value: "999999.00-999999.00",
          date: "11/6",
          change: -1, // 1: 涨 -1: 跌 0: 不变
        },
      ],
    };
    const err = { code: 500, msg: "获取行情报价失败" };
    setTimeout(() => {
      resolve(res);
    }, 500);
  });
}
